{include file="public/header" /}
<body>
<div class="header">
    <i class="layui-icon layui-icon-left"></i> 申请店铺
</div>
<form action="{:url('user/save_shop')}"  id="form"  method="post" class="form layui-form"  lay-filter='form'>
    <ul class="upd-phone-list">
        <li>
            <p>店铺类型</p>
            <div >
                <select name="shop_id" id="shop_id"  lay-filter="shop">
                    <option value="0">请选择</option>
                    {foreach name="shop" item="vo"}
                     <option value="{$vo.id}"  {if isset($info) && $info.shop_id== $vo.id}selected{/if}>{$vo.title}</option>
                    {/foreach}
                </select>
            </div>
        </li>
        <li>
            <p>申请费用</p>
            <div class="amount_1" {if isset($info) && $info.shop_id== 1}style="display: flex"{else}style="display: none"{/if}>
                {$shop[0]->amount}
            </div>
            <div class="amount_2" {if isset($info) && $info.shop_id== 2}style="display: flex"{else}style="display: none"{/if}>
                {$shop[1]->amount}
            </div>
            <div class="amount_3" {if isset($info) && $info.shop_id== 3}style="display: flex"{else}style="display: none"{/if}>
                {$shop[2]->amount}
            </div>
        </li>
        <li>
            <p>营业执照名称</p>
            <input type="text" name="name" placeholder="请填写营业执照名称" lay-verify="required"
                   lay-reqtext="请填写营业执照名称" lay-verType="tips" autocomplete="off" value="{$info?$info.name:''}">
        </li>
        <li>
            <p>地址</p>
            <input type="text" name="address" placeholder="请填写地址" lay-verify="required"
                   lay-reqtext="请填写地址" lay-verType="tips" autocomplete="off" value="{$info?$info.address:''}">
        </li>
        <li>
            <p>法人姓名</p>
            <input type="text" name="user_name" placeholder="请填写法人姓名" lay-verify="required"
                   lay-reqtext="请填写法人姓名" lay-verType="tips" autocomplete="off" value="{$info?$info.user_name:''}">
        </li>
        <li>
            <p>联系方式</p>
            <input type="number" name="phone" placeholder="请填写联系方式" lay-verify="required"
                   lay-reqtext="请填写联系方式" lay-verType="tips" autocomplete="off" value="{$info?$info.phone:''}">
        </li>
        <li>
            <p>营业执照图片</p>
            <label id="uploads_image">
                <img src="{$info?$info.image:'/static/index/img/icon15.png'}" alt="" id="image_show" style="height: 100px;padding-top: 10px">
            </label>
            <input type="hidden" name="image" id="images_value" value="{$info?$info.image:''}" lay-verify="required"
                   lay-reqtext="请上营业执照图片"
                   placeholder="请上营业执照图片"/>
        </li>
    </ul>
    {if !$shop_apply}
        <p class="save save-fixed upd-save" lay-submit lay-filter="save" formObj=".form">保存</p>
    {/if}

</form>
</body>
{include file="public/footer"/}
<script src="/static/admin/builder/js/sunSelect.js"></script>
<script>
    layui.use(['form'], function () {
        var form = layui.form
        form.on('select(shop)', function (data) {
            console.log(data.value)
            if (data.value) {
                switch (data.value) {
                    case "1":
                        $(".amount_1").show();
                        $(".amount_2").hide();
                        $(".amount_3").hide();
                        break;
                    case "2":
                        $(".amount_1").hide();
                        $(".amount_2").show();
                        $(".amount_3").hide();
                        break;
                    case "3":
                        $(".amount_1").hide();
                        $(".amount_2").hide();
                        $(".amount_3").show();
                        break;
                    default:

                }
            }
        });
    });
</script>
</html>